import request from '@/utils/request';

/**
 * 获取电脑配备
 */
export async function getEquipment(param) {
    return request('/api/entry/v1/device/query', {
        method: 'POST',
        data: param
    });
}
/**
 * 获取使用系统
 */
export async function getSystem(entryPersonnelCode) {
    return request(`/api/entry/v1/system/queryListByEntryPersonnelCode/${entryPersonnelCode}`, {
        method: 'GET'
    });
}

/**
 * 获取设备类型列表
 * 该接口全局搜索没用到
 */
// export async function getDevice() {
//     return request('/api/entry/v1/device/types', {
//         method: 'GET'
//     });
// }

/**
 * 获取设备类型列表
 * 该接口全局搜索没用到
 */
// export async function getDeviceModel(param) {
//     return request('/api/oa/entry/v1/device/models', {
//         method: 'POST',
//         data: param
//     });
// }
/**
 * 招聘负责人接收

 */
export async function getReceiveByHR(param) {
    return request('/api/entry/candidate/process/v2/receiveByHR', {
        method: 'POST',
        data: param
    });
}
/**
 * 获取使用软件
 */
export async function getSoftSelected(param) {
    return request('/api/entry/v1/soft/selected', {
        method: 'POST',
        data: param
    });
}

/**
 * 公司办公地点
 */
export async function getOfficeLocation(organizationCode) {
    return request(`/api/entry/v1/org/queryOfficeLocation/${organizationCode}`, {
        method: 'GET'
    });
}
/**
 * 公司工位
 */
export async function getOfficeStation(officeLocationCode) {
    return request(`/api/entry/v1/org/queryOfficeStation/${officeLocationCode}`, {
        method: 'GET'
    });
}
/*
 * 提交用人部门准备
 */
export async function postPrepareByDepartment(param) {
    const { temporaryStorage = undefined } = param;
    if (temporaryStorage === 1) {
        // type === 1 为暂存
        return request('/api/entry/candidate/process/v2/temporaryStorageByDepartment', {
            method: 'POST',
            data: param
        });
    }
    return request('/api/entry/candidate/process/v2/prepareByDepartment', {
        method: 'POST',
        data: param
    });
}
/*
 * 获取电脑配置默认列表
 */
export async function getDeviceList(entryPersonnelCode) {
    return request(`/api/entry/v1/asset/inst/preset/${entryPersonnelCode}`, {
        method: 'GET'
    });
}

/*
 * IT准备
 */
export async function postIt(param) {
    const { temporaryStorage = undefined } = param;
    if (temporaryStorage === 1) {
        // type === 1 为暂存
        return request('/api/entry/candidate/process/v2/temporaryStorageByWebmaster', {
            method: 'POST',
            data: param
        });
    }
    return request('/api/entry/candidate/process/v2/prepareByWebmaster', {
        method: 'POST',
        data: param
    });
}
/*
 * 行政准备
 */
export async function postAdministrative(param) {
    const { temporaryStorage = undefined } = param;
    if (temporaryStorage === 1) {
        // type === 1 为暂存
        return request('/api/entry/candidate/process/v2/temporaryStorageByAdministrative', {
            method: 'POST',
            data: param
        });
    }
    return request('/api/entry/candidate/process/v2/prepareByAdministrative', {
        method: 'POST',
        data: param
    });
}
/*
 *  行政准备
 */
export function getAdministrativeList(entryPersonnelCode) {
    return request(`/api/entry/candidate/process/v2/arrangedInfoByAdministrative/${entryPersonnelCode}`, {
        method: 'GET'
    });
}
/*
 * 获取可选资产列表
 */
export async function postAccept(id) {
    return request(`/api/entry/v1/asset/inst/receive/${id}`, {
        method: 'GET'
    });
}

/*
 * 获取所有电脑配置
 */
export async function getDeviceAll(param) {
    return request(`/api/entry/v1/asset/query/${param.entryPersonnelCode}?assetCategory=${param.assetCategory}`, {
        method: 'GET'
    });
}

/*
 * 获取已选虚拟资产列表
 */
export async function getArranged(code) {
    return request(`/api/entry/v2/asset/arranged/${code}`, {
        method: 'GET'
    });
}

/**
 * 回显
 */
export async function getAdminInfo(code) {
    return request(`/api/entry/v1/process/record/queryEntryRecordByAdministrative/${code}`, {
        method: 'GET'
    });
}
